<script setup lang="ts">
import { getMenus } from '@/composables/menu' 

const menuList = getMenus()

const emit=defineEmits(['hideMenu'])

function hideMenu(){
  emit('hideMenu')
}
</script>

<template>
  <el-menu
    router
    :unique-opened = "true"
    class="border-0"
  >
    <el-sub-menu v-for="m in menuList" :key="m.title" :index="m.index">
      <template #title>
        <span>{{ m.title }}</span>
      </template>
      <el-menu-item v-for="c in m.child" :index="c.path" @click="hideMenu">
        <span>{{ c.title }}</span>
      </el-menu-item>
    </el-sub-menu>    
  </el-menu>
</template>
